<?php foreach ($comments as $comment): ?>
    <h4><?php echo $comment->user->name; ?>:</h4>
    <?php
    echo '<div class="alertyellow">' . CHtml::encode($comment->content) . '</div>';
    if ($comment->user->userId == Yii::app()->user->id)
        echo "<div align='right'>" .
        CHtml::link("Delete Comment", array('deletecomment', 'cid' => $comment->commentId), array('submit' => array('deletecomment', 'cid' => $comment->commentId), 'confirm' => 'Are you sure you want to delete this item?')) .
        "</div>";
    ?>
    <hr>
<?php endforeach; ?>